/*
 * Graph.h
 *
 *  Created on: 11/11/2011
 *      Author: marcio
 */

#ifndef GRAPH_H_
#define GRAPH_H_

#include "Map.h"
#include <stdio.h>

typedef struct{
	int n;
	int m;
	void* edges;
	Map mapping;
	int (*fnode)(void*, void*);
}Graph;

Graph* graph_newGraph(int n, int (*fk)(void*, void*), void* nodes);

Graph* graph_readGraph(FILE* filegraph);

Graph* graph_complement(Graph* g);

Graph* graph_homophism(Graph* g, int* rename);

int graph_addEdge(Graph* g, void* v, void* u);

int graph_deleteEdge(Graph* g, void* v, void* u);

int graph_hasEdge(Graph* g, void* v, void* u);

int graph_degree(Graph* g, void* v);

void** graph_getNeigboorhood(Graph* g, void* v, int* d);

void** graph_getAntiNeigboorhood(Graph* g, void* v, int* d);

void** graph_getCommunNeigboorhood(Graph* g, void** nodes, int r, int* d);

void** graph_getCommumAntiNeigboorhood(Graph* g, void** nodes, int r, int* d);

void** graph_getTotalNeigboorhood(Graph* g, void** nodes, int r, int* d);

void** graph_getTotalAntiNeigboorhood(Graph* g, void** nodes, int r, int* d);

void graph_breathFirstSeacrh(Graph* g, void* v, void (*action)( void*));

void graph_deepFirstSeacrh(Graph* g, void* v, void (*action)( void*));

void** graph_breathFirstList(Graph* g, void* v, int* d);

void** graph_deepFirstList(Graph* g, void* v, int* d);

void** graph_getNodes(Graph* g, int* d);

int graph_delete(Graph* g);

#endif /* GRAPH_H_ */
